home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / include / Xm / GadgetP.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-06-30  |  4.4 KB  |  183 lines

  1. /* 
  2.  * (c) Copyright 1989, 1990, 1991, 1992 OPEN SOFTWARE FOUNDATION, INC. 
  3.  * ALL RIGHTS RESERVED 
  4. */ 
  5. /* 
  6.  * Motif Release 1.2
  7. */ 
  8. /*   $RCSfile: GadgetP.h,v $ $Revision: 10.1 $ $Date: 1994/02/03 15:40:40 $ */
  9. /*
  10. *  (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992 HEWLETT-PACKARD COMPANY */
  11. /*
  12. *  (c) Copyright 1989, 1990 DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS. */
  13. /*
  14. *  (c) Copyright 1988 MASSACHUSETTS INSTITUTE OF TECHNOLOGY  */
  15. #ifndef _XmGadgetP_h
  16. #define _XmGadgetP_h
  17.  
  18. #ifndef _XmNO_BC_INCL
  19. #define _XmNO_BC_INCL
  20. #endif
  21.  
  22. #include <Xm/XmP.h>
  23.  
  24. #ifdef __cplusplus
  25. extern "C" {
  26. #endif
  27.  
  28.  
  29. /*  Masks to define input the gadget is interested in  */
  30.  
  31. #define XmNO_EVENT              0x000
  32. #define XmENTER_EVENT           0x001
  33. #define XmLEAVE_EVENT           0x002
  34. #define XmFOCUS_IN_EVENT        0x004
  35. #define XmFOCUS_OUT_EVENT       0x008
  36. #define XmMOTION_EVENT          0x010
  37. #define XmARM_EVENT             0x020
  38. #define XmACTIVATE_EVENT        0x040
  39. #define XmHELP_EVENT            0x080
  40. #define XmKEY_EVENT             0x100
  41. #define XmMULTI_ARM_EVENT       0x200
  42. #define XmMULTI_ACTIVATE_EVENT  0x400
  43. #define XmBDRAG_EVENT        0x800
  44. #define XmALL_EVENT             0xFFF
  45.  
  46.  
  47. /* Gadget access Macros */
  48. #define G_ShadowThickness(g) \
  49.     (((XmGadget)(g))->gadget.shadow_thickness)
  50. #define G_HighlightThickness(g) \
  51.     (((XmGadget)(g))->gadget.highlight_thickness)
  52.  
  53. #define GCEPTR(wc)  ((XmGadgetClassExt *)(&(((XmGadgetClass)(wc))->gadget_class.extension)))
  54. #define _XmGetGadgetClassExtPtr(wc, owner) \
  55.   ((*GCEPTR(wc) && (((*GCEPTR(wc))->record_type) == owner))\
  56.    ? GCEPTR(wc) \
  57.    :((XmGadgetClassExt *) _XmGetClassExtensionPtr(((XmGenericClassExt *)GCEPTR(wc)), owner)))
  58.  
  59. #define XmGadgetClassExtVersion 1L
  60.  
  61.  
  62. /* Gadget cache header for each gadget's Cache Part */
  63.  
  64. typedef struct _XmGadgetCache
  65. {
  66.    struct _XmGadgetCache    *next;
  67.    struct _XmGadgetCache    *prev;
  68.    int                ref_count;
  69. } XmGadgetCache, *XmGadgetCachePtr;
  70.  
  71.  
  72. /* A cache entry for each class which desires gadget caching */
  73.  
  74. typedef struct _XmCacheClassPart 
  75. {
  76.    XmGadgetCache    cache_head;
  77.    XmCacheCopyProc    cache_copy;
  78.    XmGadgetCacheProc    cache_delete;
  79.    XmCacheCompareProc   cache_compare;
  80. } XmCacheClassPart, *XmCacheClassPartPtr;
  81.  
  82. typedef struct _XmGadgetCacheRef
  83. {
  84.    struct _XmGadgetCache    *next;
  85.    struct _XmGadgetCache    *prev;
  86.    int                ref_count;
  87.    int                data;
  88. } XmGadgetCacheRef, *XmGadgetCacheRefPtr;
  89.  
  90. /*  Gadget class structure  */
  91.  
  92. typedef struct _XmGadgetClassExtRec{
  93.     XtPointer           next_extension;
  94.     XrmQuark            record_type;
  95.     long                version;
  96.     Cardinal            record_size;
  97.     XmWidgetBaselineProc widget_baseline;
  98.     XmWidgetDisplayRectProc  widget_display_rect;
  99. }XmGadgetClassExtRec, *XmGadgetClassExt;
  100.  
  101. typedef struct _XmGadgetClassPart
  102. {
  103.    XtWidgetProc         border_highlight;
  104.    XtWidgetProc         border_unhighlight;
  105.    XtActionProc         arm_and_activate;
  106.    XmWidgetDispatchProc input_dispatch;
  107.    XmVisualChangeProc   visual_change;
  108.    XmSyntheticResource * syn_resources;   
  109.    int                  num_syn_resources;   
  110.    XmCacheClassPartPtr    cache_part;
  111.    XtPointer        extension;
  112. } XmGadgetClassPart;
  113.  
  114.  
  115. /*  Full class record declaration for Gadget class  */
  116.  
  117. typedef struct _XmGadgetClassRec
  118. {
  119.    RectObjClassPart  rect_class;
  120.    XmGadgetClassPart gadget_class;
  121. } XmGadgetClassRec;
  122.  
  123. #ifndef GADGET
  124. externalref XmGadgetClassRec xmGadgetClassRec;
  125. #endif
  126.  
  127.  
  128. /*  The Gadget instance record  */
  129.  
  130. typedef struct _XmGadgetPart
  131. {
  132.    Dimension shadow_thickness;
  133.    Dimension highlight_thickness;
  134.  
  135.    XtCallbackList help_callback;
  136.    XtPointer      user_data;
  137.  
  138.    Boolean traversal_on;
  139.    Boolean highlight_on_enter;
  140.    Boolean have_traversal;
  141.  
  142.    unsigned char unit_type;
  143.    XmNavigationType navigation_type;
  144.  
  145.    Boolean highlight_drawn;
  146.    Boolean highlighted;
  147.    Boolean visible;
  148.  
  149.    Mask event_mask;
  150. } XmGadgetPart;
  151.  
  152. /*  Full instance record declaration  */
  153.  
  154. typedef struct _XmGadgetRec
  155. {
  156.    ObjectPart   object;
  157.    RectObjPart  rectangle;
  158.    XmGadgetPart gadget;
  159. } XmGadgetRec;
  160.  
  161.  
  162.  
  163. /********    Private Function Declarations    ********/
  164. #ifdef _NO_PROTO
  165.  
  166. extern void _XmBuildGadgetResources() ;
  167.  
  168. #else
  169.  
  170. extern void _XmBuildGadgetResources( 
  171.                         WidgetClass c) ;
  172.  
  173. #endif /* _NO_PROTO */
  174. /********    End Private Function Declarations    ********/
  175.  
  176.  
  177. #ifdef __cplusplus
  178. }  /* Close scope of 'extern "C"' declaration which encloses file. */
  179. #endif
  180.  
  181. #endif /* _XmGadgetP_h */
  182. /* DON'T ADD ANYTHING AFTER THIS #endif */
  183.